package Framework  
{
	
	/**
	 * ...
	 * @author Menno
	 */
	public class EntityManager 
	{
		private var entityList:Array;
		
		public function EntityManager() 
		{
			entityList = new Array();
		}
		
		public function update():void
		{
			for (var i:int = 0; i < entityList.length; i++)
			{
				entityList[i].update();
			}
		}
		
		public function addEntity(e:BaseEntity):void
		{
			entityList.push(e);
		}
		
		public function getEntitiesOfType(type:String):Array
		{
			var entities:Array = new Array();
			
			for (var i:int = 0; i < entityList.length; i++)
			{
				if (entityList[i].type == type)
				{
					entities.push(entityList[i]);
				}
			}
			
			return entities;
		}
	}
	
}